

//下拉菜单



var shang = document.querySelector("#sahng");
var shangyi = document.querySelector(".shang");

shang.addEventListener("mouseover", function() {
	shangyi.style.display = "flex";
})

shangyi.addEventListener("mouseover", function() {
	shangyi.style.display = "flex";
})

shang.addEventListener("mouseout", function() {
	shangyi.style.display = "none";
})

shangyi.addEventListener("mouseleave", function() {
	shangyi.style.display = "none";
})






//个人首页

var g = document.querySelector("#geren");
var r = document.querySelector(".grern");

g.addEventListener("mouseover", function() {
	r.style.display = "block";
})

r.addEventListener("mouseover", function() {
	r.style.display = "block";
})
g.addEventListener("mouseout", function() {
	r.style.display = "none";
})
r.addEventListener("mouseleave", function() {
	r.style.display = "none";
})

var i = document.querySelector("#gouwu");
var f = document.querySelector(".gouwu");

i.addEventListener("mouseover", function() {
	f.style.display = "block";
})

f.addEventListener("mouseover", function() {
	f.style.display = "block";
})
i.addEventListener("mouseout", function() {
	f.style.display = "none";
})
f.addEventListener("mouseleave", function() {
	f.style.display = "none";
})






//搜索界面

var sosuo = document.querySelector(".nav-right-sosuo");
var btn = document.querySelector(".nav-btn");
var nei = document.querySelector(".nav-daohang");
var so = document.querySelector(".search");
var ch = document.querySelector(".cha")
var neiv = document.querySelector(".nav-right");
sosuo.addEventListener("click", function() {
	nei.style.display="none";
	neiv.style.display = "none"
	so.style.opacity = "1"
	so.style.height = "270px"
	so.style.zIndex = '1'
})
ch.addEventListener("click", function() {
	neiv.style.display = "block"
	so.style.opacity = "0"
	so.style.height = "0"
})

if(document.body.offsetWidth>"668"){
	ch.addEventListener("click", function() {
		nei.style.display="block";
	})
}

btn.addEventListener("click", function() {
	if(nei.style.display == "block"){
		nei.style.display = "none"
	}else{
		nei.style.display = "block"
	}
})


//第三页视频

var tein = document.querySelector(".tein");
var chuang = document.querySelector(".chuang")
var cha = document.querySelector("#cha");

function de(){
	tein.addEventListener("click", function() {
		chuang.style.display = "block"
	})
	cha.addEventListener("click", function() {
		chuang.style.display = "none"
	});
	
}


//电话号码

var boxa = document.querySelector(".boxa");
var p = document.querySelector("#lajij");

boxa.addEventListener("mouseover",function(){
	p.style.display = "block"
})
boxa.addEventListener("mouseleave",function(){
	p.style.display = "none"
})




//调查问卷
var img = document.querySelector(".wenjuan img");
var boxs = document.querySelector(".boxs");
var wenjuan = document.querySelector(".wenjuan");
boxs.addEventListener("click",function(){
	wenjuan.style.display = "block"
})
img.addEventListener("click",function(){
	wenjuan.style.display = "none"
})









//回到顶部
var t = document.querySelector(".box");
window.onscroll = function () {
    console.log(document.documentElement.scrollTop > 1000 || document.body.scrollTop > 1000);
    if(document.documentElement.scrollTop > 1000 || document.body.scrollTop > 1000){
        t.style.display = "block";
    }else{
        t.style.display = "none";
    }
};


t.addEventListener('click',function () {
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});